#include "QxGLSampleWidget.hpp"

#include <QTimer>

class QxGLSampleWidget::QxGLSampleWidgetPrivate
{
public:

  QxGLSampleWidgetPrivate( QxGLSampleWidget* me ) : m_self( me ) {
    m_self->connect( &m_timer, SIGNAL( timeout() ), SLOT( updateGL() ) );
  }

  QxGLSampleWidget*         m_self;
  QTimer                    m_timer;
};

QxGLSampleWidget::QxGLSampleWidget( QWidget* parent ) : QGLWidget( parent ), _pd( new QxGLSampleWidgetPrivate( this ) )
{
}

QxGLSampleWidget::~QxGLSampleWidget()
{
}

void QxGLSampleWidget::startAnimation( float mseconds )
{
  _pd->m_timer.start( mseconds );
}

void QxGLSampleWidget::stopAnimation()
{
  _pd->m_timer.stop();
}
